package com.bestom.videoplay.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.bestom.videoplay.activity.MainActivity;

public class SdReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (Intent.ACTION_MEDIA_MOUNTED.equals(action)){
            MainActivity.getInstance().readTxtFile();
        }else if (Intent.ACTION_MEDIA_REMOVED.equals(action) || Intent.ACTION_MEDIA_EJECT.equals(action)){
            Log.d("onReceive","onReceive sd out");
        }
    }
}
